import 'package:cv/cv.dart';
import 'package:cv/cv_json.dart';

// 资源
class VodSource extends CvModelBase {
  //
  final id = CvField<String>('id');

  // 名称1
  final name = CvField<String>('name');

  // 资源接口
  final base = CvField<String>('base');

  // 是否同步
  final sync = CvField<int>('sync');

  // 总子元素
  final vodTotal = CvField<int>('vod_total');

  // 本地资源数
  final vodCount = CvField<int>('vod_count');

  @override
  CvFields get fields => [id, name, base, sync, vodTotal, vodCount];
}

class Vod extends CvModelBase {
  final id = CvField<String>('id');
  final vodId = CvField<int>('vod_id');
  final typeName = CvField<String>("type_name");
  final name = CvField<String>("vod_name");
  final sub = CvField<String>("vod_sub");
  final clss = CvField<String>("vod_class");
  final pic = CvField<String>("vod_pic");
  final picThumb = CvField<String>("vod_pic_thumb");
  final actor = CvField<String>("vod_actor");
  final director = CvField<String>("vod_director");
  final writer = CvField<String>("vod_writer");
  final blurb = CvField<String>("vod_blurb");
  final area = CvField<String>("vod_area");
  final lang = CvField<String>("vod_lang");
  final year = CvField<String>("vod_year");
  final remarks = CvField<String>("vod_remarks");
  final playUrl = CvField<String>("vod_play_url");
  final timeAdd = CvField<String>("vod_time_add");
  final time = CvField<String>("vod_time");
  final score = CvField<String>("vod_score");
  final playFrom = CvField<String>("vod_play_from");

  @override
  CvFields get fields => [
        id,
        clss,
        typeName,
        name,
        sub,
        pic,
        picThumb,
        actor,
        director,
        writer,
        blurb,
        area,
        year,
        remarks,
        playUrl,
        time,
        timeAdd,
        score,
        playFrom
      ];
}

class Res extends CvModelBase {
  final code = CvField("code");
  final msg = CvField("msg");
  final page = CvField("page");
  final pagecount = CvField("pagecount");
  final limit = CvField("limit");
  final total = CvField("total");
  final list = CvModelListField<Vod>("list");

  @override
  CvFields get fields => [code, msg, page, pagecount, limit, total, list];
}
